home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
code
/
p_serlib.sit
/
Serial Library Source Code
/
get_port.c
< prev
next >
Wrap
Text File
|
1989-07-27
|
1KB
|
41 lines
/***********************************************************************/
/*
/* get_port.c
/* by Atul Butte
/* Copyright ⌐ 1989 by Microsoft Corporation
/* All Rights Reserved
/*
/* version 1.0
/*
/*
/* This module provides a routine which will convert the port number
/* into the input and output driver reference numbers.
/*
/***********************************************************************/
/***********************************************************************/
/*
/* get_port
/*
/***********************************************************************/
OSErr get_port( short port, short *prefIn, short *prefOut )
unsigned short port; /* serial port to use */
short *prefIn; /* reference number for input port */
short *prefOut; /* reference number for output port */
{
if( port == 1 ) {
*prefIn = krefAPortIn;
*prefOut = krefAPortOut;
return( noErr );
} else if( port == 2 ) {
*prefIn = krefBPortIn;
*prefOut = krefBPortOut;
return( noErr );
} else {
return( errInvalidPort );
}
}